<?php
/**
 * This file is part of webman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author    walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link      http://www.workerman.net/
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */

use Webman\Route;

//关闭默认路由
Route::disableDefaultRoute();


Route::any('/', [app\controller\Index::class,'index']);

Route::any('/app.login.byMobile', [app\app\controller\Login::class,'byMobile'])->middleware([support\middleware\BaseControl::class]);
Route::any('/app.login.webLogin', [app\app\controller\Login::class,'webLogin'])->middleware([support\middleware\BaseControl::class]);
Route::any('/app.login.verify', [app\app\controller\Login::class,'verify'])->middleware([support\middleware\BaseControl::class]);

Route::group('/app.user', function () {
    Route::any('.info.get', [app\app\controller\user\Info::class,'get']);
    Route::any('.info.set', [app\app\controller\user\Info::class,'set']);
    Route::any('.info.edt', [app\app\controller\user\Info::class,'edt']);
    Route::any('.info.setPwd', [app\app\controller\user\Info::class,'setPwd']);

    Route::any('.address.lst', [app\app\controller\user\Address::class,'lst']);
    Route::any('.address.add', [app\app\controller\user\Address::class,'add']);
    Route::any('.address.edt', [app\app\controller\user\Address::class,'edt']);
    Route::any('.address.del', [app\app\controller\user\Address::class,'del']);

    Route::any('.dept.tree', [app\app\controller\user\Dept::class,'tree']);

    Route::any('.menu.get', [app\app\controller\user\Menu::class,'get']);
})->middleware([
    support\middleware\BaseControl::class,
    support\middleware\AppUserBaseControl::class,
    support\middleware\AuthorizeControl::class
]);

Route::group('/app.sys', function () {
    Route::any('.menu.lst', [app\app\controller\sys\Menu::class,'lst']);
    Route::any('.menu.add', [app\app\controller\sys\Menu::class,'add']);
    Route::any('.menu.edt', [app\app\controller\sys\Menu::class,'edt']);
    Route::any('.menu.del', [app\app\controller\sys\Menu::class,'del']);

    Route::any('.user.lst', [app\app\controller\sys\User::class,'lst']);
    Route::any('.user.add', [app\app\controller\sys\User::class,'add']);
    Route::any('.user.edt', [app\app\controller\sys\User::class,'edt']);
    Route::any('.user.set', [app\app\controller\sys\User::class,'set']);
    Route::any('.user.del', [app\app\controller\sys\User::class,'del']);

    Route::any('.role.lst', [app\app\controller\sys\Role::class,'lst']);
    Route::any('.role.add', [app\app\controller\sys\Role::class,'add']);
    Route::any('.role.edt', [app\app\controller\sys\Role::class,'edt']);
    Route::any('.role.del', [app\app\controller\sys\Role::class,'del']);
    Route::any('.role.menu', [app\app\controller\sys\Role::class,'menu']);
    Route::any('.role.setAuth', [app\app\controller\sys\Role::class,'setAuth']);

    Route::any('.dept.lst', [app\app\controller\sys\Dept::class,'lst']);
    Route::any('.dept.add', [app\app\controller\sys\Dept::class,'add']);
    Route::any('.dept.edt', [app\app\controller\sys\Dept::class,'edt']);
    Route::any('.dept.del', [app\app\controller\sys\Dept::class,'del']);

    Route::any('.position.lst', [app\app\controller\sys\Position::class,'lst']);
})->middleware([
    support\middleware\BaseControl::class,
    support\middleware\AppUserBaseControl::class,
    support\middleware\AuthorizeControl::class
]);

Route::group('/app.im', function () {
    Route::any('.bind', [app\app\controller\im\Core::class,'bind']);
    Route::any('.sendMsg', [app\app\controller\im\Core::class,'sendMsg']);
    Route::any('.msgAcceptCallBack', [app\app\controller\im\Core::class,'msgAcceptCallBack']);
})->middleware([
    support\middleware\BaseControl::class,
    support\middleware\AppUserBaseControl::class,
    support\middleware\AuthorizeControl::class
]);
